package comet;
import java.io.Serializable;
import java.util.ArrayList;
import java.util.Collection;
import java.util.Set;
import javax.persistence.CascadeType;
import javax.persistence.Entity;
import javax.persistence.FetchType;
import javax.persistence.JoinColumn;
import javax.persistence.JoinTable;
import javax.persistence.Id;
import javax.persistence.ManyToMany;
import javax.persistence.OneToMany;
@Entity
public class College implements Serializable {
	@Id
	private String Nom;

	private String WebSite;

	public College() {
	}
	public College(String nom, String webSite) {

		this.nom = nom;

		this.webSite = webSite;
	}

	public String getNom() {
		return this.Nom;
	}
	public void setNom(String nom) {
		this.Nom = nom;
	}

	public String getWebSite() {
		return this.WebSite;
	}
	public void setWebSite(String webSite) {
		this.WebSite = webSite;
	}

	@OneToMany
	@JoinTable(name = "COLLEGE_DEPARTEMENT", joinColumns = @JoinColumn(name = "COLLEGE_ID"), inverseJoinColumns = @JoinColumn(name = "DEPARTEMENT_ID"))
	private Collection<Departement> departements = new ArrayList<Departement>();

	public void addDepartement(Departement departement) {
		if (!getDepartements().contains(departement)) {
			getDepartements().add(departement);
		}
	}

	public Collection<Departement> getDepartements() {
		return departements;
	}

}
